package com.minelx.woods.server.common;

import java.util.function.UnaryOperator;

public class ArrayAt<E> implements IAt<E> {
	private final E[] array;

	private final int at;

	public ArrayAt(E[] array, int at) {
		this.array = array;
		this.at = at;
	}

	@Override
	public void set(E value) {
		array[at] = value;
	}

	@Override
	public void map(UnaryOperator<E> mapper) {
		array[at] = mapper.apply(array[at]);
	}
}
